package org.test;

import java.util.ArrayList;
import java.util.List;

import org.nokatag.dbgrid.TreeGridItem;

public class st {

	public  static void main(String[] aa){
	String sn ="列名  like %$[wdname,ssf]% | and 列名 ='$[xxf,ooo]";
	
	List<TreeGridItem> lst = getTreePars(sn);
	for(TreeGridItem t:lst){
		System.out.println(t.getCell());
	}
	}
	
	
	public static List<TreeGridItem> getTreePars(String treefiled){
		List<TreeGridItem> tList = null;
		if(null!=treefiled){
			String[] sc = treefiled.split("\\[");
			tList = new ArrayList<TreeGridItem>();
			for(String s:sc){
				if(s.indexOf("]")!=-1){
					s = s.substring(0,s.indexOf("]"));
					tList.add(new TreeGridItem(s.split(",")[0], s.split(",")[1]));
				}
			}
		}
		return tList;
	}
}
